Redirect back with a notice after event deletion

Previously you would be redirected to `/events`, so it was not very easy
to delete many events from a list page like `/events?page=2` or
`/agents/5/events`.

Akinori MUSHA 9 years ago
parent
commit
f0fd34eb00
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/controllers/events_controller.rb

+ 1 - 1
app/controllers/events_controller.rb

@@ -33,7 +33,7 @@ class EventsController < ApplicationController
33 33
     @event.destroy
34 34
 
35 35
     respond_to do |format|
36
-      format.html { redirect_to events_path }
36
+      format.html { redirect_back events_path, notice: 'Event deleted.' }
37 37
       format.json { head :no_content }
38 38
     end
39 39
   end